<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('/webSocket/server', 'WebSocketController@server');

Route::middleware(['auth','limit'])->group(function (){
    Route::get('/', 'DashboardController@index')->name('dashboard');
    Route::get('example','HomeController@index');
    Route::any('user', 'UserController@index');
    Route::any('role', 'UserController@role');
    Route::any('permission', 'UserController@permission');
    Route::post('allotPermission', 'UserController@allotPermission');
    Route::post('submitPermission', 'UserController@submitPermission');
    Route::post('submitRole', 'UserController@submitRole'); //添加/删除角色
    Route::post('delPermission', 'UserController@delPermission'); //删除权限
    Route::post('delRole', 'UserController@delRole'); //删除角色
    Route::post('addUser', 'UserController@addUser'); //添加用户
    Route::post('editUser', 'UserController@editUser'); //编辑用户
    Route::post('delUser', 'UserController@delUser'); //删除用户

    Route::any('dbBackup', 'BackupController@index'); //数据库备份列表
    Route::post('dbBackup/create', 'BackupController@create'); //数据库备份
    Route::post('dbBackup/restore', 'BackupController@restore'); //数据库备份还原
    Route::post('dbBackup/del', 'BackupController@del'); //数据库备份删除
});
Route::get('noPermission', 'UserController@noPermission'); //没有权限
